/*
 * Scene.hh
 *
 *  Created on: Jan 9, 2013
 *      Author: Zermingore
 */

#ifndef SCENE_HH_
#   define SCENE_HH_

#   include "graphics/Light.hh"
#   include "graphics/Mesh.hh"
#   include "graphics/Texture.hh"

//#   include "core/GraphicEngine.hh"

/** it could be a Singleton class
 ** but is not declared as one. We could:
 **   have more than one window,
 **   display a scene while preparing another
 **   ...
 ** though you should consider thinking *BEFORE* instantiating a Scene
 */
class Scene
{
    public:
        Scene();
        ~Scene();

        void fillVertexBuffer();
        void createIndices();

        /** Scene initialization
         */
        void init();

        void renderScene();

        /** Displays the scene
         */
        void draw();

        // -- shd use a mesh manager class
        /** Adds a mesh to the scene
         ** \param name: path (excluding 'resources/meshes')
         ** \param position: position where we draw the mesh
         */
        void addMesh(std::string name, Vector position);

        /** Adds a mesh to the scene
         ** draws it at \param mesh.position position
         ** \param mesh: the mesh we want to draw
         */
        void addMesh(Mesh mesh);

        /** Adds a light to the scene
         ** \param name: light type
         ** \param position: position where we add the light source
         */
        void addLight(std::string name, Vector position);

        /** Adds a light to the scene
         ** \param name: light type
         ** \param position: position where we add the light source
         */
        void addLight(e_light light);


    private:
        GLint _worldLocation;
        GLuint _vbo;
        GLuint _ibo;
        float _ratio;
        Texture* _t;

//        GraphicEngine* _graphicEngine;
};

#endif /* SCENE_HH_ */
